package br.com.queroprestador.endpoint;

import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.com.queroprestador.interfaces.EndPoint;
import br.com.queroprestador.model.User;
import br.com.queroprestador.sevices.AutenticadorApi;

public class AddUserEndPoint implements EndPoint{

	@Override
	public void getEndPoint(HttpServletRequest req, HttpServletResponse res) throws Exception {
		
		RequestDispatcher rd;
		
		User user = new User();
		
		String name = req.getParameter("name");
		String password = req.getParameter("password");
		String email = req.getParameter("email");
		String cpf = req.getParameter("cpf");
		
		user.setCpf(cpf);
		user.setEmail(email);
		user.setName(name);
		user.setPassword(password);
		
		AutenticadorApi auth = new AutenticadorApi();
		auth.addUser(user);
		
		
	}

}
